{"ast":null,"code":"import _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport * as React from 'react';\nimport { getThemeProps, useThemeWithoutDefault as useTheme } from '@mui/system';\nimport useEnhancedEffect from '../utils/useEnhancedEffect';\n/**\n * @deprecated Not used internally. Use `MediaQueryListEvent` from lib.dom.d.ts instead.\n */\n\nfunction useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {\n  var supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';\n  var _React$useState = React.useState(function () {\n      if (noSsr && supportMatchMedia) {\n        return matchMedia(query).matches;\n      }\n      if (ssrMatchMedia) {\n        return ssrMatchMedia(query).matches;\n      } // Once the component is mounted, we rely on the\n      // event listeners to return the correct matches value.\n\n      return defaultMatches;\n    }),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    match = _React$useState2[0],\n    setMatch = _React$useState2[1];\n  useEnhancedEffect(function () {\n    var active = true;\n    if (!supportMatchMedia) {\n      return undefined;\n    }\n    var queryList = matchMedia(query);\n    var updateMatch = function updateMatch() {\n      // Workaround Safari wrong implementation of matchMedia\n      // TODO can we remove it?\n      // https://github.com/mui/material-ui/pull/17315#issuecomment-528286677\n      if (active) {\n        setMatch(queryList.matches);\n      }\n    };\n    updateMatch(); // TODO: Use `addEventListener` once support for Safari < 14 is dropped\n\n    queryList.addListener(updateMatch);\n    return function () {\n      active = false;\n      queryList.removeListener(updateMatch);\n    };\n  }, [query, matchMedia, supportMatchMedia]);\n  return match;\n} // eslint-disable-next-line no-useless-concat -- Workaround for https://github.com/webpack/webpack/issues/14814\n\nvar maybeReactUseSyncExternalStore = React['useSyncExternalStore' + ''];\nfunction useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia) {\n  var getDefaultSnapshot = React.useCallback(function () {\n    return defaultMatches;\n  }, [defaultMatches]);\n  var getServerSnapshot = React.useMemo(function () {\n    if (ssrMatchMedia !== null) {\n      var _ssrMatchMedia = ssrMatchMedia(query),\n        matches = _ssrMatchMedia.matches;\n      return function () {\n        return matches;\n      };\n    }\n    return getDefaultSnapshot;\n  }, [getDefaultSnapshot, query, ssrMatchMedia]);\n  var _React$useMemo = React.useMemo(function () {\n      if (matchMedia === null) {\n        return [getDefaultSnapshot, function () {\n          return function () {};\n        }];\n      }\n      var mediaQueryList = matchMedia(query);\n      return [function () {\n        return mediaQueryList.matches;\n      }, function (notify) {\n        // TODO: Use `addEventListener` once support for Safari < 14 is dropped\n        mediaQueryList.addListener(notify);\n        return function () {\n          mediaQueryList.removeListener(notify);\n        };\n      }];\n    }, [getDefaultSnapshot, matchMedia, query]),\n    _React$useMemo2 = _slicedToArray(_React$useMemo, 2),\n    getSnapshot = _React$useMemo2[0],\n    subscribe = _React$useMemo2[1];\n  var match = maybeReactUseSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n  return match;\n}\nexport default function useMediaQuery(queryInput) {\n  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  var theme = useTheme(); // Wait for jsdom to support the match media feature.\n  // All the browsers MUI support have this built-in.\n  // This defensive check is here for simplicity.\n  // Most of the time, the match media logic isn't central to people tests.\n\n  var supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';\n  var _getThemeProps = getThemeProps({\n      name: 'MuiUseMediaQuery',\n      props: options,\n      theme: theme\n    }),\n    _getThemeProps$defaul = _getThemeProps.defaultMatches,\n    defaultMatches = _getThemeProps$defaul === void 0 ? false : _getThemeProps$defaul,\n    _getThemeProps$matchM = _getThemeProps.matchMedia,\n    matchMedia = _getThemeProps$matchM === void 0 ? supportMatchMedia ? window.matchMedia : null : _getThemeProps$matchM,\n    _getThemeProps$ssrMat = _getThemeProps.ssrMatchMedia,\n    ssrMatchMedia = _getThemeProps$ssrMat === void 0 ? null : _getThemeProps$ssrMat,\n    noSsr = _getThemeProps.noSsr;\n  if (process.env.NODE_ENV !== 'production') {\n    if (typeof queryInput === 'function' && theme === null) {\n      console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\\n'));\n    }\n  }\n  var query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;\n  query = query.replace(/^@media( ?)/m, ''); // TODO: Drop `useMediaQueryOld` and use  `use-sync-external-store` shim in `useMediaQueryNew` once the package is stable\n\n  var useMediaQueryImplementation = maybeReactUseSyncExternalStore !== undefined ? useMediaQueryNew : useMediaQueryOld;\n  var match = useMediaQueryImplementation(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr);\n  if (process.env.NODE_ENV !== 'production') {\n    // eslint-disable-next-line react-hooks/rules-of-hooks\n    React.useDebugValue({\n      query: query,\n      match: match\n    });\n  }\n  return match;\n}","map":{"version":3,"names":["React","getThemeProps","useThemeWithoutDefault","useTheme","useEnhancedEffect","useMediaQueryOld","query","defaultMatches","matchMedia","ssrMatchMedia","noSsr","supportMatchMedia","window","useState","matches","match","setMatch","active","undefined","queryList","updateMatch","addListener","removeListener","maybeReactUseSyncExternalStore","useMediaQueryNew","getDefaultSnapshot","useCallback","getServerSnapshot","useMemo","mediaQueryList","notify","getSnapshot","subscribe","useMediaQuery","queryInput","options","theme","name","props","process","env","NODE_ENV","console","error","join","replace","useMediaQueryImplementation","useDebugValue"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@mui/material/esm/useMediaQuery/useMediaQuery.js"],"sourcesContent":["import * as React from 'react';\nimport { getThemeProps, useThemeWithoutDefault as useTheme } from '@mui/system';\nimport useEnhancedEffect from '../utils/useEnhancedEffect';\n/**\n * @deprecated Not used internally. Use `MediaQueryListEvent` from lib.dom.d.ts instead.\n */\n\nfunction useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {\n  const supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';\n  const [match, setMatch] = React.useState(() => {\n    if (noSsr && supportMatchMedia) {\n      return matchMedia(query).matches;\n    }\n\n    if (ssrMatchMedia) {\n      return ssrMatchMedia(query).matches;\n    } // Once the component is mounted, we rely on the\n    // event listeners to return the correct matches value.\n\n\n    return defaultMatches;\n  });\n  useEnhancedEffect(() => {\n    let active = true;\n\n    if (!supportMatchMedia) {\n      return undefined;\n    }\n\n    const queryList = matchMedia(query);\n\n    const updateMatch = () => {\n      // Workaround Safari wrong implementation of matchMedia\n      // TODO can we remove it?\n      // https://github.com/mui/material-ui/pull/17315#issuecomment-528286677\n      if (active) {\n        setMatch(queryList.matches);\n      }\n    };\n\n    updateMatch(); // TODO: Use `addEventListener` once support for Safari < 14 is dropped\n\n    queryList.addListener(updateMatch);\n    return () => {\n      active = false;\n      queryList.removeListener(updateMatch);\n    };\n  }, [query, matchMedia, supportMatchMedia]);\n  return match;\n} // eslint-disable-next-line no-useless-concat -- Workaround for https://github.com/webpack/webpack/issues/14814\n\n\nconst maybeReactUseSyncExternalStore = React['useSyncExternalStore' + ''];\n\nfunction useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia) {\n  const getDefaultSnapshot = React.useCallback(() => defaultMatches, [defaultMatches]);\n  const getServerSnapshot = React.useMemo(() => {\n    if (ssrMatchMedia !== null) {\n      const {\n        matches\n      } = ssrMatchMedia(query);\n      return () => matches;\n    }\n\n    return getDefaultSnapshot;\n  }, [getDefaultSnapshot, query, ssrMatchMedia]);\n  const [getSnapshot, subscribe] = React.useMemo(() => {\n    if (matchMedia === null) {\n      return [getDefaultSnapshot, () => () => {}];\n    }\n\n    const mediaQueryList = matchMedia(query);\n    return [() => mediaQueryList.matches, notify => {\n      // TODO: Use `addEventListener` once support for Safari < 14 is dropped\n      mediaQueryList.addListener(notify);\n      return () => {\n        mediaQueryList.removeListener(notify);\n      };\n    }];\n  }, [getDefaultSnapshot, matchMedia, query]);\n  const match = maybeReactUseSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n  return match;\n}\n\nexport default function useMediaQuery(queryInput, options = {}) {\n  const theme = useTheme(); // Wait for jsdom to support the match media feature.\n  // All the browsers MUI support have this built-in.\n  // This defensive check is here for simplicity.\n  // Most of the time, the match media logic isn't central to people tests.\n\n  const supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';\n  const {\n    defaultMatches = false,\n    matchMedia = supportMatchMedia ? window.matchMedia : null,\n    ssrMatchMedia = null,\n    noSsr\n  } = getThemeProps({\n    name: 'MuiUseMediaQuery',\n    props: options,\n    theme\n  });\n\n  if (process.env.NODE_ENV !== 'production') {\n    if (typeof queryInput === 'function' && theme === null) {\n      console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\\n'));\n    }\n  }\n\n  let query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;\n  query = query.replace(/^@media( ?)/m, ''); // TODO: Drop `useMediaQueryOld` and use  `use-sync-external-store` shim in `useMediaQueryNew` once the package is stable\n\n  const useMediaQueryImplementation = maybeReactUseSyncExternalStore !== undefined ? useMediaQueryNew : useMediaQueryOld;\n  const match = useMediaQueryImplementation(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr);\n\n  if (process.env.NODE_ENV !== 'production') {\n    // eslint-disable-next-line react-hooks/rules-of-hooks\n    React.useDebugValue({\n      query,\n      match\n    });\n  }\n\n  return match;\n}"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,aAAa,EAAEC,sBAAsB,IAAIC,QAAQ,QAAQ,aAAa;AAC/E,OAAOC,iBAAiB,MAAM,4BAA4B;AAC1D;AACA;AACA;;AAEA,SAASC,gBAAgB,CAACC,KAAK,EAAEC,cAAc,EAAEC,UAAU,EAAEC,aAAa,EAAEC,KAAK,EAAE;EACjF,IAAMC,iBAAiB,GAAG,OAAOC,MAAM,KAAK,WAAW,IAAI,OAAOA,MAAM,CAACJ,UAAU,KAAK,WAAW;EACnG,sBAA0BR,KAAK,CAACa,QAAQ,CAAC,YAAM;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